package thread;

public class SleepDemo2 {
    public static void main(String[] args){
        Thread lin = new Thread("lin"){
            @Override
            public void run(){
                System.out.println(getName()+":睡觉啦");
                try {
                    Thread.sleep(50000000);
                } catch (InterruptedException e) {
                    System.out.println(getName()+":干哈呢");
                }
                System.out.println(getName()+":醒了");
            }
        };
        Thread huang = new Thread("huang"){
            @Override
            public void run(){
                System.out.println(getName()+":爆锤");
                for (int i = 5; i >0; i--) {
                    System.out.println(getName()+":80//80");
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                    }
                }
                System.out.println(getName()+":搞定");
                System.out.println(getName()+":咣当");
                lin.interrupt();
            }
        };

        lin.start();
        huang.start();
    }
}
